package com.kl.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.kl.entity.SeckillCoupon;
import com.kl.mapper.SeckillCouponMapper;
import com.kl.service.ISeckillCouponService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author author
 * @since 2021-10-29
 */
@Service
public class SeckillCouponServiceImpl extends ServiceImpl<SeckillCouponMapper, SeckillCoupon> implements ISeckillCouponService {

    @Autowired
    private SeckillCouponMapper seckillCouponMapper;

    @Override
    public List<SeckillCoupon> seselectAll() {
        QueryWrapper wrapper = new QueryWrapper();
        wrapper.ge("start_time", new Date());
        wrapper.le("end_time",new Date());
        List<SeckillCoupon> seckillCouponList = seckillCouponMapper.selectList(wrapper);
        return seckillCouponList;
    }
}
